<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
    body>div{
        width: 200px;
        height: 200px;
        border: 1px solid red;
        overflow: hidden;/*解决高度识别0,带来的显示异常*/
    }
    #d1{
        width: 50px;
        height: 50px;
        background-color: red;

    }
    #d2{
        width: 50px;
        height: 50px;
        background-color: green;

    }
    #d3{
        width: 50px;
        height: 50px;
        background-color: blue;

    }
    ul{
        list-style-type: none;/*去掉列表图标*/
        overflow:hidden;/*解决子元素全部浮动.自动识别高度为0的问题*/

    }
    li{
        float: left;
        margin-right: 20px;
    }
    </style>
</head>
<body>
<ul>
    <li><a href="">首页</a></li>
    <li><a href="">免费课</a></li>
    <li><a href="">直播课</a></li>
    <li><a href="">精品课</a></li>
    <li><a href="">线上班</a></li>
</ul>
<div>
    <div id="d1"> </div>
    <div id="d2"> </div>
    <div id="d3"> </div>
</div>
</body>
</html>